from configparser import ConfigParser
# 实例化对象
config = ConfigParser()
config.read("../config.ini")

# 读取config文件
"""value = config.get('URL','dev_base_url')
print(value)"""

# 修改ini文件
"""config.set('URL','dev_base_url','www.baidu.com') # 修改
with open("../config.ini",'w') as f:
    config.write(f)"""
# 查看有没有修改成功
"""value = config.get('URL','dev_base_url')
print(value)"""

# 删除一个节
"""config.remove_section("WWW")
with open('../config.ini','w') as f:
    config.write(f)"""

# 查看所有的节
# print(config.sections())

# 查看某个选项是否存在于节
# print(config.has_option('URL', 'dev_base_url')) # True
# print(config.has_option('URL', 'dev_base_url1')) # False

#



